package priotityqeue;
import java.util.PriorityQueue;
public class Test1 {
    public static void main(String[] args) {
        PriorityQueue<Integer> queue = new PriorityQueue();
        //虽然调整了优先级，但是输出的顺序还是按照插入的顺序
        //值越小优先级越高
        queue.offer(50);
        queue.offer(10);
        queue.offer(20);
        queue.offer(30);
        queue.offer(40);
        queue.offer(50);

        while(!queue.isEmpty()) {
            System.out.println(queue.poll());//10 20 30 40 50 50
        }
    }
}
